home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / picture / cube.h < prev    next >
Text File  |  1993-09-23  |  1KB  |  46 lines

  1. //    Copyright 1993 Ralph Gonzalez
  2.  
  3. /*
  4. *    FILE:        cube.h
  5. *    AUTHOR:        R. Gonzalez
  6. *    CREATED:    October 6, 1990
  7. *
  8. *    Defines cube for picture application.
  9. */
  10.  
  11. # ifndef    cube_h
  12. # define    cube_h
  13.  
  14. # include    "segment.h"
  15. # include    "color.h"
  16.  
  17. /******************************************************************
  18. *   cube.  Nested segment consisting of 12 lines.
  19. ******************************************************************/
  20. class    Cube:public Nested_Segment
  21. {
  22. public:
  23.     Cube(void);
  24. };
  25.  
  26. /******************************************************************
  27. *   fast cube.  Not a nested segment.  Faster because you only
  28. *    calculate perspective projection for each line endpoint once.
  29. ******************************************************************/
  30. class    Fast_Cube:public Segment
  31. {
  32. private:
  33.     Coord3            *c[8];
  34.     color            cube_color;
  35.  
  36. public:
  37.     Fast_Cube(void);
  38. //    not implemented:
  39. //    virtual void    set(...);
  40.     virtual void    set_color(color);
  41.     virtual void    draw(Camera*,Projector*,Transformation*);
  42.     virtual void    move(Transformation*);
  43.     virtual            ~Fast_Cube(void);
  44. };
  45.  
  46. # endif